## Drawing Fig7(c)
import matplotlib.pyplot as plt
from matplotlib import rcParams

plt.rcParams['figure.dpi'] = 1200
fr = open("DrawingFig7(c)(d).csv", "r")
ls = []
for line in fr:
    line = line.replace("\n","")
    ls.append(line.split(","))
fr.close()

x_start = -3.0
x_end = 53.0
y_start = 0.0
y_end = 0.15
x1, x2, x3 = [], [], []
y1, y2, y3 = [], [], []
iLen, jLen = len(ls), len(ls[0])
for i in range(1, iLen):
    if int(ls[i][1]) == 200:
        x1.append(float(ls[i][0]))
        y1.append(float(ls[i][4]))
    elif int(ls[i][1]) == 500:
        x2.append(float(ls[i][0]))
        y2.append(float(ls[i][4]))
    elif int(ls[i][1]) == 1000:
        x3.append(float(ls[i][0]))
        y3.append(float(ls[i][4]))

plt.figure(figsize=(6.0, 4.0))
plt.xlim(x_start-0.01, x_end+0.01)
plt.ylim(y_start-0.005, y_end+0.005)
plt.xticks([0, 10, 20, 30, 40, 50], ['0', '10', '20', '30', '40', '50'])
plt.plot(x1, y1, "r.-", label="$L = 200$", linewidth=1)
plt.plot(x2, y2, "g.-", label="$L = 500$", linewidth=1)
plt.plot(x3, y3, "b.-", label="$L = 1000$", linewidth=1)
plt.xlabel('$r$')
plt.ylabel('$Std$')
plt.legend()

plt.savefig("Fig7(c).jpg")
plt.show()
